let ipcRenderer: any;
try {
	const electron = window.require("electron");
	ipcRenderer = electron.ipcRenderer;
} catch (error) {
	console.log("NOT ELECTRON ERROR");
	ipcRenderer = {
		send: (channel: string, data: any) => {
			console.log(`send-${channel}`, data);
		},
		on: (channel: string, fun: any) => {
			console.log(`on-${channel}`, fun);
		},
	};
}

export const IPCsend = (channel: string, data?: any) => {
	ipcRenderer.send(channel, data);
};

export const IPCon = (channel: string, func?: any) => {
	ipcRenderer.on(channel, func);
};
